@import "../theme/index.less";

.my-designer {
  width: 100%;
  height: 100vh;
  flex-direction: column;

  .my-designer-header {
    .flex_between();
    height: 40px;

    & > div {
      flex: 1;
    }

    .center-header {
      text-align: center;
    }

    .right-header {
      text-align: end;
    }

    .left-header, .right-header {
      & > span {
        display: inline-block;
        margin-left: 4px;
        text-align: center;
        width: 30px;
        height: 22px;
        line-height: 22px;
        border-radius: 4px;
        font-size: 15px;
        box-shadow: none;
        border-left: 1px solid transparent;
        background: @color-1;
        cursor: pointer;
        color: @color-9;
        cursor: pointer;
      }

      .no-active {
        background: #303640;
        box-shadow: inset 0 0 0 1px rgb(255 235 235 / 10%), 0 0 0 1px #181818;
        transition: .2s;
        color: @border-color-3;
      }
    }
  }

  .my-designer-content {
    padding: 0;
    height: 100%;
  }

  .my-designer-layout {
    display: flex;
    overflow: hidden;
    height: 100%;

    .my-designer-tree {
      position: relative;
      flex: 0 0 200px;
      display: flex;
      flex-direction: column;
      background-color: @background-color-7;
      border-right: 1px solid @background-color-3;

      .tree-top {
        .flex_between();
        position: relative;
        height: 30px;
        line-height: 30px;
        color: @color-7;
        text-indent: 10px;
        background: @background-color-2;
        user-select: none;

        & > div:last-child {
          padding-right: 10px;
        }
      }

      .tree-toolbar {
        .flex_common();
        background: @background-color-1;
        border-top: 1px solid @background-color-3;
        height: 32px;
        padding: 0 18px;
        flex: none;

        span {
          margin: 0 9px;
          line-height: 20px;
          text-align: center;
          background: @background-color-3;
          width: 20px;
          height: 20px;
          font-size: 14px;
          color: @color-7;
          border-radius: 1px;

          &:not(.enable):hover {
            cursor: pointer;
          }
        }

        .hovered {
          color: @color-9;
          background-color: @border-color-1;
        }
      }

      .tree-wrap {
        flex: 1;
        display: flex;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        flex-direction: column;
        position: relative;

        .layer-manager-item {
          .flex_common();
          padding: 0 8px 0 8px;
          height: 48px;
          background: @background-color-7;
          cursor: pointer;
          position: relative;

          .layer-item-thumbnail {
            width: 53px;
            height: 34px;
            flex: none;
            display: block;
            border: 1px solid @border-color-4;
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center center;
          }

          .layer-manager-thumbnail {
            flex: auto;
            width: 0;
            margin-left: 6px;

            :deep(.n-input) {
              background-color: @background-color-1;
            }
          }

          .layer-thumbail-item {
            position: absolute;
            top: 3px;
            right: 4px;
            line-height: 1;

            & > i {
              padding: 0 2px;
              font-size: 14px;
              cursor: pointer;
            }
          }
        }

        .layer-manager-item.selected {
          color: #fff;
          background: #2681ff;
        }

        .hovered {
          color: @color-9;
          background-color: rgba(143, 255, 255, 0.1);
        }

        .hidden,
        .locked {
          color: #576369;
          background-color: #1c1f25;
        }

        .last-flex-item {
          flex: auto;
          min-height: 40px;
        }
      }
    }

    .my-designer-lib {
      flex: 0 0 233px;
      width: 100%;
      height: 100%;
      overflow: hidden;
      user-select: none;
      border-right: 1px solid @background-color-3;

      .my-designer-lib-header {
        .flex_between();
        height: 30px;
        padding: 10px;
        color: @color-7;
        user-select: none;
        background-color: @background-color-2;
        border-bottom: 1px solid @background-color-3;
      }

      .my-designer-lib-body {
        height: calc(100% - 30px);
        width: 100%;
        display: flex;

        .type-list {
          flex: 0 0 50px;
          height: 100%;
          background-color: @background-color-2;
          overflow-x: hidden;

          .type-item {
            width: 100%;
            height: 55px;
            color: @color-9;
            .flex_common();
            flex-direction: column;
            text-align: center;
            cursor: pointer;
            padding: 5px 5px;
            box-sizing: border-box;

            .name {
              .text_nowrap();
              margin: 0;
              font-size: 12px;
              width: 100%;
              line-height: 16px;
              color: @color-7;
              display: block;
              font-weight: 400;
            }
          }

          .lib-is-active {
            color: @color-1;
            background: @background-color-7;
            border-left: 2px solid @border-color-1;
          }
        }

        .type-list-collapse {
          flex: 1;
          height: 100%;
          overflow-x: hidden;
          background-color: @background-color-7;

          .components-item {
            width: 100%;
            cursor: pointer;
            display: inline-block;
            vertical-align: top;
            user-select: none;
            flex: none;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--el-text-color-primary);
            border-radius: 3px;
            box-sizing: border-box;
            overflow: hidden;
            position: relative;

            &:last-child {
              border-bottom: 0;
            }

            .components-item-text {
              font-size: 12px;
              padding: 0 5px;
              text-align: left;
              line-height: 22px;
              color: rgba(255,255,255,0.86);
              .text_nowrap();
            }

            .components-item-img {
              overflow: hidden;
              width: 100%;
              background-clip: content-box;
              background-size: contain;
              background-repeat: no-repeat;
              background-position: center;
              position: relative;
              text-align: center;
              box-sizing: content-box;
              transition: border-color .2s;
              height: 72px;
            }
          }
        }
      }
    }

    .my-designer-content {
      flex: 1 1 auto;
      border-right: 1px solid @background-color-3;
    }

    .my-designer-config {
      flex: 0 0 332px;
      background-color: #191c21;
    }
  }
}

.design-fade-enter-active,
.design-fade-leave-active {
  transition: opacity .5s ease;
}

.design-fade-enter,
.design-fade-leave-active {
  opacity: 0
}
